﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SolutionModel;
using SFast;
using SolutionDAL;

namespace SolutionBLL
{
    public class T_MenuInRoleBLL
    {

        #region 通过角色ID获取该角色的所有菜单
        /// <summary>
        /// 通过角色ID获取该角色的所有菜单
        /// </summary>
        /// <param name="roleid">角色ID</param>
        /// <returns></returns>
        public List<T_MenuInRole> GetMuneInRoleID(String roleid)
        {
            T_MenuInRoleDAL dal = new T_MenuInRoleDAL();
            return dal.GetMuneInRoleID(roleid);


        }
        #endregion

        #region 添加或编辑角色的菜单权限
        /// <summary>
        /// 添加或编辑角色的菜单权限
        /// </summary>
        /// <param name="roleId">角色 ID</param>
        /// <param name="menuIds">新菜单ID集合</param>
        public void InsertOrUpdate(String roleId, List<int> menuIds)
        {
            T_MenuInRoleDAL dal = new T_MenuInRoleDAL();
            dal.InsertOrUpdate(roleId, menuIds);
        }
        #endregion

        #region 为某个角色添加某菜单权限，此方法为了实现添加新菜单时直接给超级管理员添加上权限
        /// <summary>
        /// 为某个角色添加某菜单权限，此方法为了实现添加新菜单时直接给超级管理员添加上权限
        /// </summary>
        /// <param name="roleID">角色ID</param>
        /// <param name="menuID">菜单ID</param>
        public void Add(String roleID, int menuID)
        {
            T_MenuInRoleDAL dal = new T_MenuInRoleDAL();
            dal.Add(roleID, menuID);
        }
        #endregion
    }
}
